<%--
  Created by IntelliJ IDEA.
  User: Cc
  Date: 2020/12/17
  Time: 15:03
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" +
            request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html"
      lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>用户与商品管理系统</title>
    <link rel="stylesheet" href="/static/lib/layui/css/layui.css">
    <script type="text/javascript" src="/static/lib/layui/layui.js"></script>
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery-2.1.1.min.js"></script>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">用户与商品管理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a onclick="logout()">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img" onclick="logout()">
                    退出登录
                </a>
            </li>

        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">用户管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/jsp/aaa-list.jsp" target="right">用户列表</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="/jsp/department-list.jsp" target="right">部门列表</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="/jsp/user-power.jsp" target="right">权限列表</a></dd>
                    </dl>
                </li>


                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">商品数据模块</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../sys/goGoods" target="right">商品列表</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="../sys/goModel" target="right">型号列表</a></dd>
                    </dl>
                    <dl class="layui-nav-child">
                        <dd><a href="../sys/goSpecifications" target="right">规格列表</a></dd>
                    </dl>
                </li>


                <li class="layui-nav-item">
                    <a href="javascript:;">其他管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" target="right">其他统计 </a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <!--        <div style="padding: 15px;">内容主体区域</div>-->
        <iframe scrolling="0" rameborder="0" src="" name="right" width="100%" height="98.5%"></iframe>
    </div>

    <div class="layui-footer" style="text-align: center;height: 50px">
        <!-- 底部固定区域 -->
        <p>Copyright &copy; 2015-2017 chenchen 渝ICP备xxxxxx号</p>
    </div>
</div>
<script th:src="@{layui/layui.js}" type="text/javascript"></script>
<script th:inline="javascript">
    <%
    String uAccount = request.getParameter("uAccount");
    %>
    // var e;
    // var uAccount;
    // $(function (){
    //     e = document.getElementsByName("chatWindow");
    //     uAccount = e;
    //     console.log(uAccount);
    // })

    //自动填充模块应该有的内容样式
    layui.use('element', function(){
        var element = layui.element;
    });


    function logout(){
        $.ajax({
            url:"/user/logout",
            type:"post",
            dataType:"json",
            data:{uAccount:"<%=uAccount%>" },
            success:function (data){
                layer.alert(data.msg, {icon: 6}, function () {

                    location.href = "/sys/goLogin"
                })
            }
        })
    }
</script>
</body>
</html>